package sample.business.frame.modules.impl;

import sample.business.frame.Constants;
import sample.business.frame.modules.ModuleGeneratorImpl;

import java.io.File;


/**
 * Created by lilongfei on 2016/12/18.
 */
public class SingleModuleGenerator extends ModuleGeneratorImpl {

    private SingleModuleGenerator(){}

    public static SingleModuleGenerator build(){
        return new SingleModuleGenerator();
    }

    @Override
    public void generateProject() throws Exception {

        mkBasicDirs();
        mkWebDirs();
        mkHostDirs();
        createPom(getDirVo().getWorkDir());
    }

    @Override
    public void mkHostDirs() {
        createDir(getDirVo().getHostDir() + Constants.CORE_MODULE);
        createDir(getDirVo().getHostDir() + Constants.ENTITY_MODULE);
        createDir(getDirVo().getHostDir() + Constants.MODULES_MODULE);
    }
}
